import com.sun.image.codec.jpeg.*;
import java.awt.image.*;
import java.awt.geom.*;
import java.awt.*;
import java.io.*;
class PaintCanvas extends Canvas {
   BufferedImage image;
   Graphics2D g_2d;
   PaintCanvas() {
      image=new BufferedImage(300,300,BufferedImage.TYPE_INT_RGB);
      g_2d=image.createGraphics();
      Rectangle2D rect = new Rectangle2D.Double(0,0,300,300);
      Ellipse2D ellipse= new Ellipse2D. Double (30,30,80,30);
      g_2d.setColor(Color.yellow);
      g_2d.fill(rect); 
      g_2d.setColor(Color.black);
      AffineTransform trans=new  AffineTransform(); 
      for(int i=1;i<=24;i++){
         trans.rotate(15.0*Math.PI/180,70,45);
         g_2d.setTransform(trans);
         g_2d.draw(ellipse); 
      }
   }
   public BufferedImage getImage() {
      return image;
   }
}
public class JPG {
  public static void main(String args[]) {
    try {  
       JPEGImageEncoder encoder=
       JPEGCodec.createJPEGEncoder(new FileOutputStream("geometry.jpg"));
       PaintCanvas canvas=new PaintCanvas(); 
       encoder.encode(canvas.getImage());
    }
    catch(Exception ee) {}
  }
}
